package org.example.yunshu.demos.service;

import org.example.yunshu.demos.constant.Constants;
import org.example.yunshu.demos.mapper.FriendMapper;
import org.example.yunshu.demos.model.Friend;
import org.example.yunshu.demos.model.UserInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpSession;
import java.util.List;

@Service
public class FriendService {
    @Autowired
    private FriendMapper friendMapper ;


    public Object getFriendListByUserId(HttpSession httpSession) {
       UserInfo userInfo = (UserInfo) httpSession.getAttribute(Constants.USERINFO_KEY);
       List<Friend> list = friendMapper.getFriendListByUserId(userInfo);
       return list ;
    }
}
